package com.woniuxy.config;

import com.woniuxy.utils.MyInterceptor;
import com.woniuxy.utils.MyInterceptor2;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.HandlerExceptionResolver;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import java.util.List;

/**
 * @Author: ideaAdmin
 * TODO: 把自定义的类 注册为 webmvc的配置
 * Date: 2022/2/15:12:12
 * Description:
 */

@Configuration
public class InterceptorConfiguration implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        //建造者设计模式 可以一直点方法 然后构建出一个庞大的对象
        registry.addInterceptor(new MyInterceptor()).addPathPatterns("/rbacmanager/**").order(0);
        registry.addInterceptor(new MyInterceptor2()).addPathPatterns("/rbacmanager/**").order(1);
    }


}
